<?php
// <copyright file="AuthenticationType.cs" company="NQtec">
// Copyright (c) 2008, 2009 All Right Reserved, http://www.dqer.com/
// Copyright (c) 2008, 2009 All Right Reserved, http://www.nqtec.com/
//
// This source is part of the DQER library that released under the LGPL.
// Please see the License.txt file for more information.
// All other rights reserved.
//
// THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY 
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// </copyright>
// <author>Victor Gatkov</author>
// <email>v.gatkov@nqtec.com</email>
// <email>info@dqer.com</email>
// <date>2008-09-11</date>
// <summary>Contains a base, abstract class for an AuthorisationPolicyProvider</summary>

class Auth {

//   function Auth() {

//   }

   function uid() {
    global $session;
     return $session->get_uid();
   }
   function is_signed() {
     if ($this->uid()) return true;
       else return false;
   }
   function is_admin() {
     global $session; // SET Admin Level at CONFIG file !!!!
     if ($session->get_ulv()>7) return true;
       else return false;
   }
   function get_user_uid() {
      $uid = $this->uid();
      if (isset($_REQUEST['uid'])) {
         if($this->is_admin()) {       
           $uid = $_REQUEST['uid']; // $uid = $clear->all($_GET['uid']); is admin for sure, so no cleaning needed
         }
      }
      return $uid;
   }

};

?>
